package com.itWaiLong.Controller.Learning;

import com.itWaiLong.Dao.learning_resource;
import com.itWaiLong.Result.Result;
import com.itWaiLong.Service.LearningService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/learning/update")
public class updateLearningController {

    @Autowired
    private LearningService learningService;

    /**
     * 编辑学习资料
     * @param learningResource
     * @return
     */
    @PostMapping
    public Result update(@RequestBody learning_resource learningResource){
        log.info("编辑学习资料信息：{}",learningResource);
        learningService.update(learningResource);
        return Result.success();
    }
}
